import request from '@/utiles/request'

// 获取操作日志列表
export function getOperationLogs(params) {
  return request({
    url: '/opera/list',
    method: 'get',
    params
  })
}

// 删除操作日志
export function deleteOperationLog(id) {
  return request({
    url: `/opera/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除操作日志
export function batchDeleteOperationLogs(ids) {
  return request({
    url: '/opera/batch/delete',
    method: 'delete',
    data: { ids }
  })
}

// 更新操作日志
export function updateOperationLog(id, data) {
  return request({
    url: `/opera/update/${id}`,
    method: 'put',
    data
  })
}

// 批量更新操作日志状态
export function batchUpdateOperationLogStatus(ids, status) {
  return request({
    url: '/opera/batch/update',
    method: 'put',
    data: { ids, status }
  })
}

// 获取部门列表
export function getDepartments() {
  return request({
    url: '/department/list',
    method: 'get'
  })
}
